#include <iostream>
#include <Windows.h>
#include <Game.h>
#include "Types.h"
#include "Constant.h"
#include "BufferedRandom3D.h"
//#include "PerlinNoiseMap.h"

int main(int argc, char **argv)
{
	LineSeperator();
	SetConsoleColor(IBLUE);
	LineSeperator();

	//Initialize game
	Game *pMcPP = new Game();
	if(!pMcPP->Initialize())
	{
		pMcPP->Cleanup();
		return 64;
	}

	//Run game while it should be running
	while(pMcPP->IsGameRunning())
	{
		pMcPP->Run();
	}

	//Cleanup resources
	pMcPP->Cleanup();

	int termCode = pMcPP->GetTerminationCode();
	if(termCode != 0)
		return termCode;
	return 0;
}